package com.management.service.Impl;

import com.management.dao.MaterialsDao;
import com.management.dao.MaterialsTypeDao;
import com.management.po.MaterialsType;
import com.management.service.MaterialsTypeService;
import com.management.vo.MaterialsTypeVO;
import com.management.vo.MaterialsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * @author Xs
 *  物品种类业务逻辑实现类
 * @version 1.0
 */
import java.util.List;
@Service
public class MaterialsTypeServiceImpl implements MaterialsTypeService {
    @Autowired
    MaterialsTypeDao materialsTypeDao;
    @Override
    public List<MaterialsTypeVO> findAll() {
        return materialsTypeDao.findAll();
    }

    @Override
    public MaterialsType findByMaterialsTypeId(int materialsTypeId) {
        return materialsTypeDao.findByMaterialsTypeId(materialsTypeId);
    }

    @Override
    public List<MaterialsType> findByCompanyId(int companyId) {
        return materialsTypeDao.findByCompanyId(companyId) ;
    }

    @Override
    public boolean add(MaterialsType materialsType) {
        return materialsTypeDao.add(materialsType)>0?true:false;
    }

    @Override
    public boolean update(MaterialsType materialsType) {
        return materialsTypeDao.update(materialsType)>0?true:false;
    }

    @Override
    public boolean delete(int[] arrays) {
        return materialsTypeDao.delete(arrays)>0?true:false;
    }
}
